<?php
namespace app\admin\controller;
use think\Controller;
use think\Session;
if (!Session::has('DSL','admin')){
    die('非法登录');
}
class Web extends Controller
{
    public function index()
    {
        $web_info = db('web')->field(['domain_name','ip'])->find();
        $this->assign('web',$web_info);
        return $this->fetch('index');
    }
    
    public function save_web()
    {
        $result = array('err' => '1','content' => '');
        $model = model('Web');
        $web_info = input('post.');
        $save_web = $model->saveWeb($web_info);
        if ($save_web == false) {
            $result['content'] = '保存失败！';
            return $result;
        }
        $result['err'] = '0';
        $result['content'] = '保存成功！';
        return $result;
    }
}